<!DOCTYPE html>
<html>
<head>
    <title>Event binding</title>
    <meta charset="utf-8">
    <link href="../../content/shared/styles/examples-offline.css" rel="stylesheet">
    <link href="../../../styles/kendo.common.min.css" rel="stylesheet">
    <link href="../../../styles/kendo.rtl.min.css" rel="stylesheet">
    <link href="../../../styles/kendo.default.min.css" rel="stylesheet">

    <script src="../../../js/jquery.min.js"></script>
    <script src="../../../js/kendo.web.min.js"></script>
    <script src="../../content/shared/js/console.js"></script>
    <script>
        
    </script>
    
    
</head>
<body>
    
        <a class="offline-button" href="../index.html">Back</a>
    
    <div id="example" class="k-content">
    <div class="demo-section">

        <button class="k-button" data-bind="events: { click: listener, dblclick: listener, mouseover: listener, mouseout: listener }">Button</button>

    </div>
    <script>
        $(document).ready(function() {
            var viewModel = kendo.observable({
                listener: function(e) {
                    kendoConsole.log("Event: " + e.type);
                }
            });

            kendo.bind($("#example"), viewModel);
        });
    </script>
    <div class="console"></div>
    <div class="code-sample">
        <h4 class="code-title">View source code</h4>
<pre class="prettyprint">
&lt;div id=&quot;example&quot;&gt;
    &lt;button data-bind=&quot;events:{ click: listener, dblclick: listener, mouseover: listener, mouseout: listener }&quot;&gt;Button&lt;/button&gt;
&lt;/div&gt;
</pre>
    </div>
    <div class="code-sample">
        <h4 class="code-title">View model source code</h4>
<pre class="prettyprint">
var viewModel = kendo.observable({
    listener: function(e) {
        kendoConsole.log(&quot;Event: &quot; + e.type);
    }
});

kendo.bind($(&quot;#example&quot;), viewModel);
</pre>
    </div>
    <style scoped>
        .demo-section {
        	width: 250px;
        	text-align: center;
        }
        #example button {
            width: 200px;
            height: 60px;
        }
    </style>
</div>

	
			
</body>
</html>
